const mongoose = require('mongoose');

const verificationSchema = new mongoose.Schema({
    userId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'User',
        required: true
    },
    realName: {
        type: String,
        required: [true, '真实姓名不能为空']
    },
    idNumber: {
        type: String,
        required: [true, '身份证号不能为空'],
        unique: true
    },
    idCardFront: {
        type: String,
        required: [true, '身份证正面照片不能为空']
    },
    idCardBack: {
        type: String,
        required: [true, '身份证反面照片不能为空']
    },
    verified: {
        type: Boolean,
        default: false
    },
    createdAt: {
        type: Date,
        default: Date.now
    },
    signature: {
        type: String,
        required: [true, '电子签名不能为空']
    }
});

module.exports = verificationSchema